home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / cbm / 2884 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.8 KB  |  43 lines

  1. Newsgroups: comp.sys.cbm
  2. Path: undergrad.math.uwaterloo.ca!csbruce
  3. From: csbruce@ccnga.uwaterloo.ca (Craig Bruce)
  4. Subject: Re: anyone doing heavy math on a c64?
  5. Sender: news@undergrad.math.uwaterloo.ca (news spool owner)
  6. Message-ID: <DMsHCw.8G0@undergrad.math.uwaterloo.ca>
  7. Date: Wed, 14 Feb 1996 23:31:44 GMT
  8. References: <4e2l0q$n8f@turing.fwi.uva.nl> <4f49t9$2q5@madeline.INS.CWRU.Edu> <4fchhs$2r1@tor.abc.se> <4ftcnm$bfs@news.acns.nwu.edu>
  9. Nntp-Posting-Host: ccnga.uwaterloo.ca
  10. Organization: University of Waterloo, Canada (eh!)
  11.  
  12. In article <4ftcnm$bfs@news.acns.nwu.edu>, Stephen Judd <sjudd@nwu.edu> wrote:
  13.  
  14. >Peter T Karlsson <dat95pkn@idt.mdh.se> wrote:
  15. >>C=64+64*INT(.1+.9)
  16. >>
  17. >>will give C 64 for a C64 and 128 on a C128!
  18. >
  19. >I find this very interesting.  Does anyone have an explanation for this?
  20.  
  21. Floating-point arithmetic is a bit of a crap shoot anyway.  Maybe they subtly
  22. changed the addition code between the two versions, or...
  23.  
  24. >I started to investigate this further.  On the 64 (at least, in 64 mode),
  25. >INT(.1+.9) returns 0, but A=.1+.9:?INT(A) returns 1.  I started tracing through
  26. >the 128 ROMs, but not very rigorously (yet).  I haven't solved the problem, but
  27. >I did discover something else very interesting:
  28.  
  29. I have some vague notions about the floating-point accumulators (FACs)
  30. storing a number with slightly more precision than a floating-point
  31. variable, so this may be what is happening.  If the number doesn't have to
  32. leave the FACs (which it doesn't in the above first example), then there may
  33. be a slightly different answer from if it does.  Maybe the C128 stores or
  34. doesn't store intermediate results from the FACs while the C64 doesn't/
  35. does.
  36.  
  37. Keep on Hackin'!
  38.  
  39. -Craig Bruce
  40. csbruce@ccnga.uwaterloo.ca
  41. "That's a good choice, sir: why, I have the exact same model at home!"
  42.                              -- any untrustworthy sales-scum
  43.